/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
/**
 *
 * @author ANH
 */
public class Remark {
    int x;
    int y;
    int kind;
    boolean istouched;
    Image remark;
    public Remark(int _kind)
    {
        kind=_kind;
        if(kind==0)
        {
             x=60;
             y=15;
        }
        else
        {
               x=135;
                y=15;
        }
       
    }
    public void loadGraphics(Image _Image)
    {
        remark=_Image;
    }
    public void Render(Graphics g)
    {
             int anchor = Graphics.TOP|Graphics.LEFT;
             g.drawImage(remark, x, y, anchor);
    }
     private final Rectangle getArea() {

         return new Rectangle(x, y,40 , 40);
    }

    public final boolean isPressed(int x, int y) {
        return getArea().isPointInside(x, y);
    }
    public boolean OnSelelected(int x,int y){// dành cho chạm( tạm thời)
        if(isPressed(x,y))
        {
            istouched=true;
            return true;
        }
        return false;
    }
    public void OnReleased()
    {
        istouched=false;
    }
}
